home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / man / man-part1 / cat1 / function.1 < prev    next >
Text File  |  1999-09-16  |  1KB  |  67 lines

  1.  
  2.  
  3.  
  4. functions(1)                   Scilab Function                   functions(1)
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. NAME
  12.   "Scilab object : function" - Scilab procedure
  13.  
  14. DESCRIPTION
  15.   Functions are Scilab procedures ("macro", "function" and "procedure" have
  16.   the save meaning). Usually, they are defined in files with an editor and
  17.   loaded into Scilab by getf or through a library.
  18.  
  19.   They can also be defined on-line (see deff). A file which contains a func-
  20.   tion must begin as follows:
  21.   function [y1,...,yn]=foo(x1,...,xm)
  22.   The yi are output variables calculated as functions of input variables and
  23.   variables existing in Scilab when the function is executed.  A function can
  24.   be compiled for faster execution. Collections of functions can be collected
  25.   in libraries.  Functions which begin with % sign (e.g. %foo) and whose
  26.   arguments are lists are used to perform specific operations: for example,
  27.   z=%rmr(x,y) is equivalent to z=x*y when x and z are rationals (i.e.
  28.   x=list('r',n,d,[]) with n and d polynomials).
  29.  
  30.   For example if the file myfct.sci contains:
  31.   function [x,y]=myfct(a,b)
  32.   x=a+b
  33.   y=a-b
  34.   you can load and use it in the following way:
  35.   getf('pathname/myfct.sci','c')
  36.   [a,b]=myfct(1,2)
  37.  
  38. SEE ALSO
  39.   deff, getf, comp, lib.
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.